<?php
if (class_exists('yii\redis\Cache')) {
    return [
        'class' => 'yii\redis\Cache',
        'redis' => [
            'hostname' => 'localhost',
            'port' => 6379,
            'database' => 0,
        ],
    ];
}
if (class_exists('Memcached') || class_exists('Memcache')) {
    return [
        'class' => 'yii\caching\MemCache',
        'useMemcached' => class_exists('Memcached'),
        'servers' => [
            [
                'host' => '127.0.0.1',
                'port' => 11211,
                // 'weight' => 60,
            ],
        ]
    ];
}
return [
    'class' => 'yii\caching\FileCache',
    'directoryLevel' => 0,
    'cachePath' => '@runtime/cache',
];
